<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>为什么需要浮动</title>

    <style>
        div {
            width: 1000px;
            height: 500px;
        }

        .left {
            width: 200px;
            height: 300px;
            float: left;
            background-color: pink;
        }

        .right {
            width: 200px;
            height: 300px;
            float: right;
            background-color: pink;
        }
    </style>

</head>
<body>
    
    <img src="为什么需要浮动.png" alt="">
    <br><br>
    <img src="什么是浮动.png" alt="">

    <div>
        <div class="left"></div>
        <div class="right"></div>
    </div>

</body>
</html>